@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 210 50% 98%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 199 89% 48%;
    --primary-foreground: 210 40% 98%;

    --secondary: 160 84% 39%;
    --secondary-foreground: 210 40% 98%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 35 92% 51%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 199 89% 48%;

    --radius: 0.5rem;

    --sidebar-background: 210 50% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 199 89% 48%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 160 84% 39%;
    --sidebar-accent-foreground: 0 0% 98%;
    --sidebar-border: 214.3 31.8% 91.4%;
    --sidebar-ring: 199 89% 48%;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 199 89% 48%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 160 84% 39%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 35 92% 51%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
    
    --sidebar-background: 222.2 84% 4.9%;
    --sidebar-foreground: 210 40% 98%;
    --sidebar-primary: 199 89% 48%;
    --sidebar-primary-foreground: 210 40% 98%;
    --sidebar-accent: 160 84% 39%;
    --sidebar-accent-foreground: 210 40% 98%;
    --sidebar-border: 217.2 32.6% 17.5%;
    --sidebar-ring: 212.7 26.8% 83.9%;
  }

  /* Performance optimized animations using GPU acceleration */
  @keyframes fade-in {
    from {
      opacity: 0;
      transform: translateY(20px) translateZ(0);
    }
    to {
      opacity: 1;
      transform: translateY(0) translateZ(0);
    }
  }
  
  @keyframes scale-in {
    from {
      opacity: 0;
      transform: scale(0.95) translateZ(0);
    }
    to {
      opacity: 1;
      transform: scale(1) translateZ(0);
    }
  }
  
  @keyframes slide-in-right {
    from {
      transform: translateX(100%) translateZ(0);
    }
    to {
      transform: translateX(0) translateZ(0);
    }
  }
  
  @keyframes slide-in-left {
    from {
      transform: translateX(-100%) translateZ(0);
    }
    to {
      transform: translateX(0) translateZ(0);
    }
  }
  
  @keyframes shimmer {
    0% {
      background-position: -468px 0;
    }
    100% {
      background-position: 468px 0;
    }
  }
}

@layer components {
  .animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
    will-change: opacity, transform;
  }
  
  .animate-scale-in {
    animation: scale-in 0.4s ease-out forwards;
    will-change: opacity, transform;
  }
  
  .animate-slide-in-right {
    animation: slide-in-right 0.5s ease-out forwards;
    will-change: transform;
  }
  
  .animate-slide-in-left {
    animation: slide-in-left 0.5s ease-out forwards;
    will-change: transform;
  }
  
  /* Optimized shimmer effect for loading states */
  .animate-shimmer {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0));
    background-size: 900px 100%;
    will-change: background-position;
  }
}

/* Improved travel card with optimized transitions */
.travel-card {
  @apply transition-all duration-300 will-change-transform;
  transform: translateZ(0); /* Force GPU acceleration */
}

.travel-card:hover {
  @apply shadow-lg;
  transform: translateY(-4px) translateZ(0);
}

/* 隐藏滚动条样式 */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
